<template>
  <div :class="pageName">
      <div class="form">
            <el-form :inline="true" :model="searchForm" class="demo-form-inline">
                <el-form-item>
                    <!-- <el-button type="primary" @click="onSubmit">查询</el-button> -->
                    <el-button type="primary" @click="onAdd">新建</el-button>
                </el-form-item>
            </el-form>
      </div>

      <div class="form-body">
          <el-table
            :data="tableData.dataList"
            border
            style="width: 100%">
            <el-table-column
                prop="id"
                label="编号">
            </el-table-column>
            <el-table-column
                prop="class"
                label="种类名称">
            </el-table-column>
            <el-table-column
                prop="img"
                label="种类图标">
            </el-table-column>
            <el-table-column
                prop="createTime"
                label="添加日期">
            </el-table-column>
            <el-table-column label="操作">
                <template slot-scope="scope">
                    <el-button
                    size="mini"
                    @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                    <el-button
                    size="mini"
                    type="danger"
                    @click="handleDelete(scope.$index, scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
        <div class="clearfix pt15">
            <div class="fr">
                <el-pagination
                    background
                    layout="total, prev, pager, next"
                    :total="tableData.total"
                    :page-size="10"
                    :current-page="tableData.currentPage"
                    @current-change="currentChange">
                </el-pagination>
            </div>
        </div>
      </div>
      <Edit />
  </div>
</template>

<script>
import { mapGetters } from 'vuex';
import pageMixin from "@/mixins/pageMixin";
import Edit from "./components/editSetting";

export default {
    mixins: [pageMixin],

    components: { Edit },

    data () {
        return {
            searchForm: {
            },
            pageName: 'businessSetting'
        }
    },

    computed: {
        ...mapGetters({
            tableData: 'businessSetting/tableData',
            editData: 'businessSetting/editData'
        })
    },

    created () {
        
    },

    methods: {
        
    }
}
</script>

<style >

</style>
